package org.ofbiz.framework.spring;

import java.io.IOException;
import java.lang.annotation.Annotation;
import java.util.Locale;
import java.util.Map;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.MessageSourceResolvable;
import org.springframework.context.NoSuchMessageException;
import org.springframework.core.ResolvableType;
import org.springframework.core.env.Environment;
import org.springframework.core.io.Resource;

public class SpringContext implements ApplicationContext {
	protected ApplicationContext ctx = null;
	SpringContext(ApplicationContext applicationContext){
		ctx = applicationContext;
	}
	public AutowireCapableBeanFactory getAutowireCapableBeanFactory()
			throws IllegalStateException {
		return ctx.getAutowireCapableBeanFactory();
	}
	public String getDisplayName() {
		return ctx.getDisplayName();
	}
	public ApplicationContext getParent() {
		return ctx.getParent();
	}
	public long getStartupDate() {
		return ctx.getStartupDate();
	}
	public boolean containsBeanDefinition(String arg0) {
		return ctx.containsBeanDefinition(arg0);
	}
	public int getBeanDefinitionCount() {
		return ctx.getBeanDefinitionCount();
	}
	public String[] getBeanDefinitionNames() {
		return ctx.getBeanDefinitionNames();
	}
	public String[] getBeanNamesForType(Class arg0) {
		return ctx.getBeanNamesForType(arg0);
	}
	public String[] getBeanNamesForType(Class arg0, boolean arg1, boolean arg2) {
		return ctx.getBeanNamesForType(arg0, arg1, arg2);
	}
	public Map getBeansOfType(Class arg0) throws BeansException {
		return ctx.getBeansOfType(arg0);
	}
	public Map getBeansOfType(Class arg0, boolean arg1, boolean arg2)
			throws BeansException {
		return ctx.getBeansOfType(arg0, arg1, arg2);
	}
	public boolean containsBean(String arg0) {
		return ctx.containsBean(arg0);
	}
	public String[] getAliases(String arg0) {
		return ctx.getAliases(arg0);
	}
	public Object getBean(String arg0) throws BeansException {
		return ctx.getBean(arg0);
	}
	public Object getBean(String arg0, Class arg1) throws BeansException {
		return ctx.getBean(arg0, arg1);
	}
	public Class getType(String arg0) throws NoSuchBeanDefinitionException {
		return ctx.getType(arg0);
	}
	public boolean isPrototype(String arg0)
			throws NoSuchBeanDefinitionException {
		return ctx.isPrototype(arg0);
	}
	public boolean isSingleton(String arg0)
			throws NoSuchBeanDefinitionException {
		return ctx.isSingleton(arg0);
	}
	public boolean isTypeMatch(String arg0, Class arg1)
			throws NoSuchBeanDefinitionException {
		return ctx.isTypeMatch(arg0, arg1);
	}
	public boolean containsLocalBean(String arg0) {
		return ctx.containsLocalBean(arg0);
	}
	public BeanFactory getParentBeanFactory() {
		return ctx.getParentBeanFactory();
	}
	public String getMessage(MessageSourceResolvable arg0, Locale arg1)
			throws NoSuchMessageException {
		return ctx.getMessage(arg0, arg1);
	}
	public String getMessage(String arg0, Object[] arg1, Locale arg2)
			throws NoSuchMessageException {
		return ctx.getMessage(arg0, arg1, arg2);
	}
	public String getMessage(String arg0, Object[] arg1, String arg2,
			Locale arg3) {
		return ctx.getMessage(arg0, arg1, arg2, arg3);
	}
	public void publishEvent(ApplicationEvent arg0) {
		ctx.publishEvent(arg0);
	}
	public Resource[] getResources(String arg0) throws IOException {
		return ctx.getResources(arg0);
	}
	public ClassLoader getClassLoader() {
		return ctx.getClassLoader();
	}
	public Resource getResource(String arg0) {
		return ctx.getResource(arg0);
	}
    public <A extends Annotation> A findAnnotationOnBean(String arg0, Class<A> arg1) {
        return ctx.findAnnotationOnBean(arg0, arg1);
    }
    public Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> arg0)
            throws BeansException {
        return ctx.getBeansWithAnnotation(arg0);
    }
    public <T> T getBean(Class<T> arg0) throws BeansException {
        return ctx.getBean(arg0);
    }
    public Object getBean(String arg0, Object... arg1) throws BeansException {
        return ctx.getBean(arg0, arg1);
    }
    public String getId() {
        return ctx.getId();
    }
	@Override
	public Environment getEnvironment() {
		// TODO Auto-generated method stub
		return ctx.getEnvironment();
	}
	/*@Override
	public String[] getBeanNamesForType(Class<?> arg0) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public String[] getBeanNamesForType(Class<?> arg0, boolean arg1,
			boolean arg2) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public <T> Map<String, T> getBeansOfType(Class<T> arg0)
			throws BeansException {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public <T> Map<String, T> getBeansOfType(Class<T> arg0, boolean arg1,
			boolean arg2) throws BeansException {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public <T> T getBean(String arg0, Class<T> arg1) throws BeansException {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public boolean isTypeMatch(String arg0, Class<?> arg1)
			throws NoSuchBeanDefinitionException {
		// TODO Auto-generated method stub
		return false;
	}*/
	@Override
	public String[] getBeanNamesForAnnotation(Class<? extends Annotation> arg0) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public String[] getBeanNamesForType(ResolvableType arg0) {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public <T> T getBean(Class<T> arg0, Object... arg1) throws BeansException {
		// TODO Auto-generated method stub
		return null;
		
	}
	@Override
	public boolean isTypeMatch(String arg0, ResolvableType arg1) throws NoSuchBeanDefinitionException {
		// TODO Auto-generated method stub
		return false;
	}
	@Override
	public void publishEvent(Object arg0) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public String getApplicationName() {
		// TODO Auto-generated method stub
		return null;
	}
}
